-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagemap Rounding #558
Pagemap Rounding #558
Conversation
auto end = pointer_align_down( | ||
// Calculate range in pagemap that is associated to this space. | ||
// Over calculate to cover any unaligned parts at either end. | ||
auto b_align = pointer_align_down(b, bits::one_at_bit(GRANULARITY_BITS)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this might take b_align
below b
, and so logically start our PageMap
out of bounds, that's OK because we never access the MetaEntry
-s associated with the PageMap
itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is b_align only used in address and size computations? If yes, then would it be clearer and safer to get the address of b and align the address down? That way no wild pointer exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I have tried to make this capability less code as it is just addresses like you suggest:
9542fbe
I am very happy with this change now. |
Check for possible overlap between heap and pagemap, but writing and reading the heap.
This commit allows the pagemap to return unaligned range of memory. This means that bump allocation of multiple pagemaps doesn't waste as much space.
9542fbe
to
bcfd5ef
Compare
This PR ensures that if a pagemap is used in a fixed region that has very large granularity it does require undue additional alignment.